<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>DoitPHP权限控件-DEMO</title>
<style type="text/css">
<!--
body {
	margin: 0px;
	padding: 0px;
	background-color: #FFF;
	text-align: center;
}
.total {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
	line-height: 25px;
	color: #000;
	height: auto;
	width: 750px;
	padding: 0px;
	text-align: left;
	margin-top: 30px;
	margin-right: auto;
	margin-bottom: 0px;
	margin-left: auto;
	border: 1px solid #AACCEE;
}
.check_list {
	height: 15px;
	width: 15px;
}
-->
</style>
<?php echo script::add('jquery'); ?>
<script type="text/javascript">
function change_state(option_id, state){
	$.post('<?php echo $this->create_url('index/ajax_user_setting'); ?>', {user_id:'<?php echo $data['user_id']; ?>', acl_option_id:option_id, setting:state}, function(data){if(data==101){alert('操作成功!');location.reload();}else{alert('操作失败!请重新操作');}});
}
</script>
</head>

<body>
<div class="total">
<table width="750" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="60" align="center">DoitPHP权限控制(DEMO版)</td>
  </tr>
  <tr>
    <td height="30"><table width="750" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="10" height="30" bgcolor="#D3DFEE">&nbsp;</td>
        <td width="150" align="center" bgcolor="#D3DFEE"><a href="<?php echo $this->create_url('index/index', array('mode'=>1, 'page'=>$page), false); ?>">操作(option)管理</a></td>
        <td width="150" align="center" bgcolor="#D3DFEE"><a href="<?php echo $this->create_url('index/index', array('mode'=>2, 'page'=>$page), false); ?>">角色（role）管理</a></td>
        <td width="150" align="center" bgcolor="#FFFFFF">用户(user)管理</td>
        <td width="290" bgcolor="#D3DFEE">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="360" align="left" valign="top"><table width="750" border="0" cellspacing="0" cellpadding="0">      
      <tr>
        <td height="40" align="right"><a href="<?php echo $this->create_url('index/index', array('mode'=>3, 'page'=>$page), false); ?>" target="_self">返回角色管理列表</a>&nbsp;&nbsp;</td>
      </tr>
      <tr>
        <td height="60"><table width="750" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="170" height="30">&nbsp;</td>
            <td width="80" align="center">用户名：</td>
            <td width="500" align="left" style="color:#C00;"><?php echo $data['name']; ?></td>
          </tr>
          <tr>
            <td width="130" height="30">&nbsp;</td>
            <td width="80" align="center">角色：</td>
            <td align="left"><?php echo $data['role_name']; ?></td>
          </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td height="15"></td>
      </tr>
      <tr>
        <td><table width="750" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="15" colspan="3"></td>
    </tr>
  <tr>
    <td width="15">&nbsp;</td>
    <td><table width="720" border="0" cellspacing="1" cellpadding="0" style="background:#CCC;">
      <tr>
        <td width="30" height="30" align="center" bgcolor="#FFFFFF">&nbsp;</td>
        <td align="center" bgcolor="#FFFFFF">操作(option)名</td>
        <td width="60" align="center" bgcolor="#FFFFFF">状态</td>
        <td width="100" align="center" bgcolor="#FFFFFF">操作</td>
      </tr>
     <?php foreach($list_data as $key=>$lines) {  ?>
      <tr>
        <td width="30" height="30" align="center" bgcolor="#FFFFFF"><?php echo $key + 1; ?>.</td>
        <td align="left" bgcolor="#FFFFFF">&nbsp;<?php echo $lines['auth_option_name']; ?></td>
        <td align="center" bgcolor="#FFFFFF"><?php if($lines['auth_setting'] == 1) { echo '开启'; } else{ echo '禁用'; } ?></td>
        <td width="80" align="center" bgcolor="#FFFFFF"><?php if ($lines['auth_setting'] == 1){?> <a href="javascript:void(0);" onclick="change_state(<?php echo $lines['auth_option_id']; ?>, 0)">禁用</a>
          <?php } else { ?> <a href="javascript:void(0);" onclick="change_state(<?php echo $lines['auth_option_id']; ?>, 1)">开启</a><?php }?></td>
      </tr>
      <?php } ?>
    </table></td>
    <td width="15">&nbsp;</td>
  </tr>
  <tr>
    <td height="15" colspan="3"></td>
    </tr>
        </table>
</td>
      </tr>
    </table></td>
  </tr>
</table>
</div>
</body>
</html>